/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package data;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author stana
 */
@Entity
@Table(name = "requirement")
@NamedQueries(
{
    @NamedQuery(name = "Requirement.findAll", query = "SELECT r FROM Requirement r"),
    @NamedQuery(name = "Requirement.findById", query = "SELECT r FROM Requirement r WHERE r.id = :id"),
    @NamedQuery(name = "Requirement.findByDate", query = "SELECT r FROM Requirement r WHERE r.date = :date"),
    @NamedQuery(name = "Requirement.findByPhoneNumber", query = "SELECT r FROM Requirement r WHERE r.phoneNumber = :phoneNumber"),
    @NamedQuery(name = "Requirement.findByLatitude", query = "SELECT r FROM Requirement r WHERE r.latitude = :latitude"),
    @NamedQuery(name = "Requirement.findByLongitude", query = "SELECT r FROM Requirement r WHERE r.longitude = :longitude"),
    @NamedQuery(name = "Requirement.findByPlace", query = "SELECT r FROM Requirement r WHERE r.place = :place"),
    @NamedQuery(name = "Requirement.findByType", query = "SELECT r FROM Requirement r WHERE r.type = :type")
})
public class Requirement implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "date_")
    @Temporal(TemporalType.DATE)
    private Date date;
    @Basic(optional = false)
    @Column(name = "phone_number")
    private long phoneNumber;
    @Basic(optional = false)
    @Column(name = "latitude")
    private float latitude;
    @Basic(optional = false)
    @Column(name = "longitude")
    private float longitude;
    @Column(name = "place")
    private String place;
    @Basic(optional = false)
    @Column(name = "type")
    private String type;
    @Column(name = "msl")
    private int msl;

    public Requirement()
    {
    }

    public Requirement(Integer id)
    {
        this.id = id;
    }

    public Requirement( Date date, long phoneNumber, String place,float latitude, float longitude, String type,int msl)
    {
        //this.id = id;
        this.date = date;
        this.phoneNumber = phoneNumber;
        this.latitude = latitude;
        this.longitude = longitude;
        this.type = type;
        this.msl=msl;
        this.place=place;
    }

    public Integer getId()
    {
        return id;
    }

    public void setId(Integer id)
    {
        this.id = id;
    }

    public Date getDate()
    {
        return date;
    }

    public void setDate(Date date)
    {
        this.date = date;
    }

    public long getPhoneNumber()
    {
        return phoneNumber;
    }

    public void setPhoneNumber(long phoneNumber)
    {
        this.phoneNumber = phoneNumber;
    }

    public float getLatitude()
    {
        return latitude;
    }

    public void setLatitude(float latitude)
    {
        this.latitude = latitude;
    }

    public float getLongitude()
    {
        return longitude;
    }

    public void setLongitude(float longitude)
    {
        this.longitude = longitude;
    }

    public String getPlace()
    {
        return place;
    }

    public void setPlace(String place)
    {
        this.place = place;
    }

    public String getType()
    {
        return type;
    }

    public void setType(String type)
    {
        this.type = type;
    }

    public int getMsl()
    {
        return msl;
    }

    public void setMsl(int msl)
    {
        this.msl = msl;
    }

    

    @Override
    public int hashCode()
    {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object)
    {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Requirement))
        {
            return false;
        }
        Requirement other = (Requirement) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)))
        {
            return false;
        }
        return true;
    }

    @Override
    public String toString()
    {
        return "data.Requirement[id=" + id + "]";
    }

}
